

*** CLASS
clear all 
 

use "potentials.dta", clear



gen att5_headscarf_rev=-att5_headscarf+3

gen cultpos=((att4_immig-1)/2+(att5_headscarf_rev-1)+(att6_gender-1)/2+(att7_ecology-1)/2)/4
gen econpos=((att1_earlyret-1)/2+(att2_childcare-1)+(att3_inheritax-1)/2+(att8_jobprotection-1)+(att9_housing-1)/2)/5

*** scp

reg choice c.cultpos##c.econpos##i.ccode if oesch_3==1, cl(~respondentid)


** FOUR SCENARIOS



margins, at( cultpos=(0 1) econpos=(0) ccode=(1)) ///
at( cultpos=(0 1) econpos=(1) ccode=(1)) ///
at( cultpos=(0 1) econpos=(0) ccode=(2)) ///
at( cultpos=(0 1) econpos=(1) ccode=(2)) ///
at( cultpos=(0 1) econpos=(0) ccode=(3)) ///
at( cultpos=(0 1) econpos=(1) ccode=(3)) ///
at( cultpos=(0 1) econpos=(0) ccode=(4)) ///
at( cultpos=(0 1) econpos=(1) ccode=(4)) ///
at( cultpos=(0 1) econpos=(0) ccode=(5)) ///
at( cultpos=(0 1) econpos=(1) ccode=(5)) ///
at( cultpos=(0 1) econpos=(0) ccode=(6)) ///
at( cultpos=(0 1) econpos=(1) ccode=(6))

matrix marg=r(table)[1..4,1..24]

*****
* Prod workers
****

reg choice c.cultpos##c.econpos##i.ccode if oesch_3==2, cl(~respondentid)



** FOUR SCENARIOS

margins, at( cultpos=(0 1) econpos=(0) ccode=(1)) ///
at( cultpos=(0 1) econpos=(1) ccode=(1)) ///
at( cultpos=(0 1) econpos=(0) ccode=(2)) ///
at( cultpos=(0 1) econpos=(1) ccode=(2)) ///
at( cultpos=(0 1) econpos=(0) ccode=(3)) ///
at( cultpos=(0 1) econpos=(1) ccode=(3)) ///
at( cultpos=(0 1) econpos=(0) ccode=(4)) ///
at( cultpos=(0 1) econpos=(1) ccode=(4)) ///
at( cultpos=(0 1) econpos=(0) ccode=(5)) ///
at( cultpos=(0 1) econpos=(1) ccode=(5)) ///
at( cultpos=(0 1) econpos=(0) ccode=(6)) ///
at( cultpos=(0 1) econpos=(1) ccode=(6))
matrix marg2=r(table)[1..4,1..24]


matrix marg3=marg,marg2
matrix marg3=marg3'

svmat marg3
rename marg31 b
rename marg32 se
gen cilow=b-1.96*se
gen cihigh=b+1.96*se
gen index=_n if _n<49

graph twoway (bar b index, barwidth(.5)) (rcap cihigh cilow index), ///
xlabel(2.5 "AT" 6.5 "CH" 10.5 "DE" 14.5 "DK" 18.5 "ES" 22.5 "SE" 26.5 "AT" 30.5 "CH" 34.5 "DE" 38.5 "DK" 42.5 "ES" 46.5 "SE") scheme(plottig) legend(off)  title("Socio-cultural professionals                                           Production workers    ") xtitle("Preferences for programs by occupation and country") xline(24.5, lcolor(black) lpattern(dash) lwidth(thick)) xline(4.5 8.5 12.5 16.5 20.5 28.5 32.5 36.5 40.5 44.5, lcolor(gs14) lwidth(thick))  yscale(range(-.1 0.8)) ylabel(0(.2)1.2)  plotregion(color(white)) note("Order: Econ left/Cult left // Econ left/Cult mod // Econ mod/Cult left // Econ mod/Cult mod") ///
text(1.1 1 "Econ left/Cult left", size(tiny) orientation(vertical)) ///
text(1.1 2 "Econ left/Cult mod", size(tiny) orientation(vertical)) ///
text(1.1 3 "Econ mod/Cult left", size(tiny) orientation(vertical)) ///
text(1.1 4 "Econ mod/Cult mod", size(tiny) orientation(vertical))



graph export "FigureE1.png", as(png) replace
graph export "FigureE1.tif", as(png) width(2000) replace



*AGE

*****
*** YOUNG
*****

clear all 
 

use "potentials.dta", clear



gen att5_headscarf_rev=-att5_headscarf+3

gen cultpos=((att4_immig-1)/2+(att5_headscarf_rev-1)+(att6_gender-1)/2+(att7_ecology-1)/2)/4
gen econpos=((att1_earlyret-1)/2+(att2_childcare-1)+(att3_inheritax-1)/2+(att8_jobprotection-1)+(att9_housing-1)/2)/5

reg choice c.cultpos##c.econpos##i.ccode if age_groups==1, cl(~respondentid)


** FOUR SCENARIOUS

margins, at( cultpos=(0 1) econpos=(0) ccode=(1)) ///
at( cultpos=(0 1) econpos=(1) ccode=(1)) ///
at( cultpos=(0 1) econpos=(0) ccode=(2)) ///
at( cultpos=(0 1) econpos=(1) ccode=(2)) ///
at( cultpos=(0 1) econpos=(0) ccode=(3)) ///
at( cultpos=(0 1) econpos=(1) ccode=(3)) ///
at( cultpos=(0 1) econpos=(0) ccode=(4)) ///
at( cultpos=(0 1) econpos=(1) ccode=(4)) ///
at( cultpos=(0 1) econpos=(0) ccode=(5)) ///
at( cultpos=(0 1) econpos=(1) ccode=(5)) ///
at( cultpos=(0 1) econpos=(0) ccode=(6)) ///
at( cultpos=(0 1) econpos=(1) ccode=(6))

matrix marg=r(table)[1..4,1..24]

*****
* OLD
****

reg choice c.cultpos##c.econpos##i.ccode if age_groups==4, cl(~respondentid)



** FOUR SCENARIOUS

margins, at( cultpos=(0 1) econpos=(0) ccode=(1)) ///
at( cultpos=(0 1) econpos=(1) ccode=(1)) ///
at( cultpos=(0 1) econpos=(0) ccode=(2)) ///
at( cultpos=(0 1) econpos=(1) ccode=(2)) ///
at( cultpos=(0 1) econpos=(0) ccode=(3)) ///
at( cultpos=(0 1) econpos=(1) ccode=(3)) ///
at( cultpos=(0 1) econpos=(0) ccode=(4)) ///
at( cultpos=(0 1) econpos=(1) ccode=(4)) ///
at( cultpos=(0 1) econpos=(0) ccode=(5)) ///
at( cultpos=(0 1) econpos=(1) ccode=(5)) ///
at( cultpos=(0 1) econpos=(0) ccode=(6)) ///
at( cultpos=(0 1) econpos=(1) ccode=(6))

matrix marg2=r(table)[1..4,1..24]

matrix marg3=marg,marg2
matrix marg3=marg3'

svmat marg3
rename marg31 b
rename marg32 se
gen cilow=b-1.96*se
gen cihigh=b+1.96*se
gen index=_n if _n<49

graph twoway (bar b index, barwidth(.5)) (rcap cihigh cilow index), ///
xlabel(2.5 "AT" 6.5 "CH" 10.5 "DE" 14.5 "DK" 18.5 "ES" 22.5 "SE" 26.5 "AT" 30.5 "CH" 34.5 "DE" 38.5 "DK" 42.5 "ES" 46.5 "SE") scheme(plottig) legend(off)  title("Voters under 35                                                        Voters over 65") xtitle("Preferences for programs by age group and country") xline(24.5, lcolor(black) lpattern(dash) lwidth(thick)) xline(4.5 8.5 12.5 16.5 20.5 28.5 32.5 36.5 40.5 44.5, lcolor(gs14) lwidth(thick))  yscale(range(-.1 0.8)) ylabel(0(.2).8)  plotregion(color(white)) note("Order: Econ left/Cult left // Econ left/Cult mod // Econ mod/Cult left // Econ mod/Cult mod") ///
text(1 1 "Econ left/Cult left", size(tiny) orientation(vertical)) ///
text(1 2 "Econ left/Cult mod", size(tiny) orientation(vertical)) ///
text(1 3 "Econ mod/Cult left", size(tiny) orientation(vertical)) ///
text(1 4 "Econ mod/Cult mod", size(tiny) orientation(vertical))




graph export "FigureE2.png", as(png) replace
graph export "FigureE2.tif", as(tif) replace





*************************************
************* EDUCATION

clear all 
 

use "potentials.dta", clear

gen att5_headscarf_rev=-att5_headscarf+3

gen cultpos=((att4_immig-1)/2+(att5_headscarf_rev-1)+(att6_gender-1)/2+(att7_ecology-1)/2)/4
gen econpos=((att1_earlyret-1)/2+(att2_childcare-1)+(att3_inheritax-1)/2+(att8_jobprotection-1)+(att9_housing-1)/2)/5


*** High educ

reg choice c.cultpos##c.econpos##i.ccode if educ_2==3, cl(~respondentid)


** FOUR SCENARIOS

margins, at( cultpos=(0 1) econpos=(0) ccode=(1)) ///
at( cultpos=(0 1) econpos=(1) ccode=(1)) ///
at( cultpos=(0 1) econpos=(0) ccode=(2)) ///
at( cultpos=(0 1) econpos=(1) ccode=(2)) ///
at( cultpos=(0 1) econpos=(0) ccode=(3)) ///
at( cultpos=(0 1) econpos=(1) ccode=(3)) ///
at( cultpos=(0 1) econpos=(0) ccode=(4)) ///
at( cultpos=(0 1) econpos=(1) ccode=(4)) ///
at( cultpos=(0 1) econpos=(0) ccode=(5)) ///
at( cultpos=(0 1) econpos=(1) ccode=(5)) ///
at( cultpos=(0 1) econpos=(0) ccode=(6)) ///
at( cultpos=(0 1) econpos=(1) ccode=(6))

matrix marg=r(table)[1..4,1..24]

*****
* Low educ
****

reg choice c.cultpos##c.econpos##i.ccode if educ_2==1, cl(~respondentid)

** FOUR SCENARIOS

margins, at( cultpos=(0 1) econpos=(0) ccode=(1)) ///
at( cultpos=(0 1) econpos=(1) ccode=(1)) ///
at( cultpos=(0 1) econpos=(0) ccode=(2)) ///
at( cultpos=(0 1) econpos=(1) ccode=(2)) ///
at( cultpos=(0 1) econpos=(0) ccode=(3)) ///
at( cultpos=(0 1) econpos=(1) ccode=(3)) ///
at( cultpos=(0 1) econpos=(0) ccode=(4)) ///
at( cultpos=(0 1) econpos=(1) ccode=(4)) ///
at( cultpos=(0 1) econpos=(0) ccode=(5)) ///
at( cultpos=(0 1) econpos=(1) ccode=(5)) ///
at( cultpos=(0 1) econpos=(0) ccode=(6)) ///
at( cultpos=(0 1) econpos=(1) ccode=(6))

matrix marg2=r(table)[1..4,1..24]


matrix marg3=marg,marg2
matrix marg3=marg3'

svmat marg3
rename marg31 b
rename marg32 se
gen cilow=b-1.96*se
gen cihigh=b+1.96*se
gen index=_n if _n<49

graph twoway (bar b index, barwidth(.5)) (rcap cihigh cilow index), ///
xlabel(2.5 "AT" 6.5 "CH" 10.5 "DE" 14.5 "DK" 18.5 "ES" 22.5 "SE" 26.5 "AT" 30.5 "CH" 34.5 "DE" 38.5 "DK" 42.5 "ES" 46.5 "SE") scheme(plottig) legend(off)  title( "High education                                                        Low education") xtitle("Preferences for programs by education and country") xline(24.5, lcolor(black) lpattern(dash) lwidth(thick)) xline(4.5 8.5 12.5 16.5 20.5 28.5 32.5 36.5 40.5 44.5, lcolor(gs14) lwidth(thick))  yscale(range(-.1 0.8)) ylabel(0(.2).8)  plotregion(color(white)) note("Order: Econ left/Cult left // Econ left/Cult mod // Econ mod/Cult left // Econ mod/Cult mod") ///
text(.8 1 "Econ left/Cult left", size(tiny) orientation(vertical)) ///
text(.8 2 "Econ left/Cult mod", size(tiny) orientation(vertical)) ///
text(.8 3 "Econ mod/Cult left", size(tiny) orientation(vertical)) ///
text(.8 4 "Econ mod/Cult mod", size(tiny) orientation(vertical))


graph export "FigureE4.png", as(png) replace
graph export "FigureE4.tif", as(tif) width(2000) replace


